<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Welcome extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->helper('form', 'url');
        $this->load->model('m_sanpham');
        $this->load->model('m_categories');

        //Lay du lieu category menu cho layout dung chung.
        $data['categories'] = $this->m_categories->getcategoryparent();
        $data['allcategory'] = $this->m_categories->getallcategories();
        $data['menu'] = array('categories' => $data['categories'], 'allcategory' => $data['allcategory']);
        $this->load->vars($data);
    }

    public function index() {
        $data['products'] = $this->m_sanpham->getallproducts();
        $data['categorycon'] = $this->m_categories->getcategorycon(0);

        //var_dump($data['quanaonam']);
        $data['show'] = 'frontend/home/index';
        $this->load->view('frontend/layout', $data);
    }

}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */